<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head th:replace="fragments/header :: common-header">
    <title>添加景点 - 景点投票系统</title>
</head>
<body>
<div th:replace="fragments/navbar :: navbar"></div>

<div class="container mt-4">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow-sm">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0">添加景点</h5>
                </div>
                <div class="card-body">
                    <form th:action="@{/spot/add}" method="post" enctype="multipart/form-data">
                        <div class="mb-3">
                            <label for="name" class="form-label">景点名称</label>
                            <input type="text" class="form-control" id="name" name="name" required>
                        </div>
                        <div class="mb-3">
                            <label for="description" class="form-label">景点描述</label>
                            <textarea class="form-control" id="description" name="description" rows="3"></textarea>
                        </div>
                        <div class="mb-3">
                            <label for="location" class="form-label">位置</label>
                            <input type="text" class="form-control" id="location" name="location">
                        </div>
                        <div class="mb-3">
                            <label for="image" class="form-label">景点图片</label>
                            <input type="file" class="form-control" id="image" name="image" accept="image/*">
                        </div>
                        <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                            <a th:href="@{/spot/list}" class="btn btn-secondary me-md-2">取消</a>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>